//
//  TestViewController.swift
//  RXSwiftTest
//
//  Created by ZhangBo on 2019/4/13.
//  Copyright © 2019 ZhangBo. All rights reserved.
//

import UIKit
import RxSwift
import RxCocoa

class TestViewController: BaseViewController {
    @IBOutlet weak var textField: UITextField!
    @IBOutlet weak var label: UILabel!
    let disposeBag = DisposeBag()

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .yellow
        textField.rx.text.orEmpty.asDriver().drive(onNext: { [weak self] text in
            DispatchQueue.main.asyncAfter(deadline: .now() + 8) {
                print("当前输入内容：\(String(describing: text))")
                self?.label.text = text
            }
        }).disposed(by: disposeBag)
    }


}
